package cn.yangliu.nacos.management.model;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

import static cn.yangliu.nacos.management.constant.ManagementValidateConstants.AUTHORITY_BUTTON_MISS;
import static cn.yangliu.nacos.management.constant.ManagementValidateConstants.AUTHORITY_NAME_MISS;
import static cn.yangliu.nacos.management.constant.ManagementValidateConstants.AUTHORITY_SORTNO_MISS;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * The type of nacos.
 *
 * @author 问道于盲
 * @date 2020 -01-01
 */
@Data
public class AuthorityInsertModel {

    /**
     * current class instance's member.
     * The Name.
     */
    @ApiModelProperty(value = "资源名称", required = true, example = "新增")
    @NotBlank(message = AUTHORITY_NAME_MISS)
    private String name;

    /**
     * current class instance's member.
     * The Authority.
     */
    @ApiModelProperty(value = "权限标识符", example = "user:insert")
    private String authority;

    /**
     * current class instance's member.
     * The Sort no.
     */
    @ApiModelProperty(value = "排序号", required = true, example = "0")
    @NotNull(message = AUTHORITY_SORTNO_MISS)
    private Integer sortNo = 0;

    /**
     * current class instance's member.
     * The Button.
     */
    @ApiModelProperty(value = "是否是按钮", required = true, example = "false")
    @NotNull(message = AUTHORITY_BUTTON_MISS)
    private Boolean button = false;

    /**
     * current class instance's member.
     * The Parent id.
     */
    @ApiModelProperty(value = "父资源id", example = "1")
    private Long parentId;

}
